<div class="header card-header d-flex justify-content-between align-items-center">
  <h3 class="text-center flex-grow-1">学生管理系统</h3>
  <div class="right-items d-flex align-items-center">
    <h4 th:text="${session.username}" class="d-inline mb-0 me-2"></h4>
    <img th:src="@{/img/ren.jpg}" width="50" height="50" />
    <a th:href="@{/logout}" class="text-decoration-none">退出</a>
  </div>
</div>
<style>
  /* 顶部 header 样式 */
  .header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .header h3 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
  }

  /* 右侧元素容器样式 */
  .header .right-items {
    display: flex;
    align-items: center;
  }

  /* 右侧元素间隔样式 */
  .header .right-items > * {
    margin-left: 10px;
  }

  img{
    border-radius: 10%;
  }
</style>
